package com.xuyiwei.xblog.service;

import com.xuyiwei.xblog.entity.SysUser;
import com.baomidou.mybatisplus.extension.service.IService;

import javax.servlet.http.HttpServletRequest;
import java.util.Set;

/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author xuyiwei
 * @since 2019-07-30
 */
public interface ISysUserService extends IService<SysUser> {

    /**
     * 根据用户名得到用户
     * @param username
     * @return
     */
    SysUser findByUserName(String username);

    /**
     * 根据用户id查询权限
     * @param userId
     * @return
     */
    Set<String> findPermsByUserId(Integer userId);

    /**
     * 通过用户id查询角色集合
     * @param userId
     * @return
     */
    Set<String> findRoleIdByUserId(Integer userId);

    /**
     * 登录
     * @param username
     * @param password
     * @param captcha
     * @param request
     * @return
     */
    String login(String username, String password, String captcha,String uuid, HttpServletRequest request);
}
